package com.medical.controller;

import com.medical.pojo.MessageCenter;
import com.medical.service.MessageCenterService;
import com.medical.vo.Rmed;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("messageCenter")
public class MessageCenterController {

    @Autowired
    private MessageCenterService messageCenterService;

    @RequestMapping("/findAll")
    public List<MessageCenter> findAll(@RequestBody MessageCenter messageCenter){
        return messageCenterService.findAll(messageCenter);
    }

    @RequestMapping("/findById")
    public MessageCenter findById(Integer id){
        return messageCenterService.findById(id);
    }

    @RequestMapping("/addMessage")
    public Rmed addMessage(@RequestBody MessageCenter messageCenter){
    	return messageCenterService.addMessage(messageCenter);
    }

    @RequestMapping("/deleteOne")
    public void deleteOne(Integer id){
         messageCenterService.deleteOne(id);
    }
}
